<template>
  <section :class="[!isSetPageBackground ? 'c-bg-white' : '']" class="c-ph24 c-pv24">
    <div class="c-pv24 c-flex-row c-ph24 c-br16 c-text-hidden" :class="!isSetPageBackground ? item.backgroundStyleType == 2 ? 'c-bg-sgray' : 'boxShadow' : item.backgroundStyleType == 2 ? 'c-bg-white' : ''">
      <div v-if="item.items[0] != null" :class="[item.items && item.items.length == 2 ? (item.backgroundStyleType == 1 ? 'bd1-r1-f2' : 'bd1-r1-ff') : '', (pageTextColor && isSetPageBackground && item.backgroundStyleType != 2) ? 'pageTextColor' : 'c-fc-sblack']" class="c-fs24  c-w0 c-flex-grow1 c-textAlign-l c-flex-row c-aligni-center c-justify-center c-pr24" @click="clickCompanyIntro">
        <i class="iconfont c-fs30 c-mr10" :class="(pageTextColor && isSetPageBackground && item.backgroundStyleType != 2) ? 'pageTextColor' : 'theme-fc'">&#xe662;</i>
        <span>{{item.items[0].name}}</span>
      </div>
      <div v-if="item.items[1] != null" class="c-fs24 c-w0 c-flex-grow1 c-textAlign-l c-flex-row c-aligni-center c-justify-center c-pl24" :class="(pageTextColor && isSetPageBackground && item.backgroundStyleType != 2) ? 'pageTextColor' : 'c-fc-sblack'" @click="clickContactUs">
        <i class="iconfont c-fs30 c-mr10" :class="(pageTextColor && isSetPageBackground && item.backgroundStyleType != 2) ? 'pageTextColor' : 'theme-fc'">&#xe62e;</i>
        <span>{{item.items[1].name}}</span>
      </div>
    </div>
  </section>
</template>
<script>
import { appRouterChange } from "@/mixin/appRouterPush.js";
export default {
  mixins: [appRouterChange],
  components: {
  },
  props: {
    item: {
      type: Object,
      default: () => {
        return {}
      },
    },
    pageName: {//首页 INDEX 预览页 PREVIEW_INDEX 微页面 MICRO_PAGE
      type: String,
      default: "INDEX"
    },
  },
  data() {
    return {
      companyAuth: JSON.parse(localStorage.getItem("companyAuth")),
      isSetPageBackground: sessionStorage.getItem("isSetPageBackground") || 0,
      pageTextColor: sessionStorage.getItem('pageTextColor') || '',
    };
  },
  methods: {
    //点击公司简介
    clickCompanyIntro() {
      if (this.pageName == 'PREVIEW_INDEX') {
        return;
      }
      let toPath = "/homePage/about/companyProfile";
      this.iosAppRouteChange(toPath);
    },
    //联系我们
    clickContactUs() {
      if (this.pageName == 'PREVIEW_INDEX') {
        return;
      }
      let toPath = "/homePage/about/contactUs";
      this.iosAppRouteChange(toPath);
    },
  },
};
</script>
<style scoped>
.boxShadow {
  box-shadow: 0 0 6px 0 rgba(32,0,0,.06);
}
.bd1-r1-f2 {border-right: 1px solid #f2f2f2;}
.bd1-r1-ff {border-right: 1px solid #ffffff;}
</style>